package day05;
import javax.sql.rowset.FilteredRowSet;
import java.awt.*;
import java.util.Arrays;
import java.util.Scanner;
public class HomeWork {
    public static void main(String[] args) {

        //1)九九乘法表
/*
        for (int num=1;num<=9;num++){
            for (int i=1;i<=num;i++){
                System.out.print(i+"*"+num+"="+i*num+"\t");
            }
            System.out.println();
        }
        System.out.println("-------------------------");

        for (int num=9;num>=1;num--){
            for (int i=1;i<=num;i++){
                System.out.print(i+"*"+num+"="+i*num+"\t");

            }
            System.out.println();
        }


 */


//2.1声明一个数组
        /*
        int[]a=new int[8];
        double[]b = new double[20];
        boolean[]c = new boolean[10];

         */

//2.2)数组的初始化：
        /*
        int[] a=new int[3];
        int[] b ={1,2,3,4,};
        int[] c =new int[]{11,22,33,44};
        int[] d ;
        d =new int[20];

         */

//2.3 数组的访问：
/*
        int[] a = new int[3];
        System.out.println(a.length);//3
        System.out.println(a[0]);//默认值
        a[0]=100;
        a[1]=200;
        a[2]=300;
        System.out.println(a[0]);//100
        System.out.println(a[1]);//200
        System.out.println(a[2]);//300
        System.out.println(a[a.length-1]);//300 =a[2]

 */

//2.4数组的遍历：
/*
        int[] a =new int[10];
        for (int i=0;i<a.length;i++){
            a[i]=(int) (Math.random()*100);
            System.out.println(a[i]);

        }

 */
/*
        int [] a =new int[10];
        for (int i=0;i<a.length;i++){
            a[i]=(int) (Math.random()*100);
            System.out.println(a[i]);
        }

 */
        //2.5数组的复制
       /*
        int []a={10,20,30,40,50};
        int []b =new int[10];
        System.arraycopy(a,0,b,0,4);
        for (int i=0;i<b.length;i++){

            System.out.print(" "+b[i]);//10 20 30 40 0 0 0 0
        }

        */

        /*
        int[] a={10,20,30,40};
        int[] b=Arrays.copyOf(a,5);
        for (int i=0;i<b.length;i++){
            System.out.println(b[i]);//10 20 30 40 0

        }

         */
//3求数组的最大值：
        /*
        int[] a =new int[10];
        for (int i=0;i<a.length;i++){
            a[i]=(int) (Math.random()*100);
            System.out.print(" "+a[i]);
        }

        int max =a[0];
        for (int i=0;i<a.length;i++){
            if (a[i]>max){
                max=a[i];
            }
        }
        System.out.println("最大值为："+max);
        System.out.println();

        a = Arrays.copyOf(a,a.length+1);
        a[a.length-1]=max;
        for (int i=0;i<a.length;i++){
            System.out.print(" "+a[i]);
        }

         */


//        int sum =0;
//        for (int i=1;i<=100;i++){
//           sum=sum+i;
//        }
//        System.out.println("sum="+sum);

        for (int i=0;i<=100;i++){
           // Scanner sc = new Scanner(System.in);
            System.out.println("输入一个数字");
            int num = new Scanner(System.in).nextInt();
            if (num!=88){
                continue;
            }else {
                System.out.println("答对了");
                break;
            }
        }

















    }
}
